//
//  BuKeInformationVCNavView.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/26.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "BuKeInformationVCNavView.h"

@implementation BuKeInformationVCNavView

- (void)initOption{
    self.backButton.hidden = YES;
    [self addSubview:self.timeButton];
    [self addSubview:self.nianjiButton];
    [_timeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_right).offset(-230);
        make.centerY.equalTo(self.mas_centerY);
        make.width.equalTo(@100);
        make.height.equalTo(@20);
    }];
    [_nianjiButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.timeButton.mas_right).offset(5*fw);
        make.centerY.equalTo(self.mas_centerY);
        make.width.equalTo(@100);
        make.height.equalTo(@20);
    }];
}
- (MinButtonViewBtn *)timeButton{
    if (!_timeButton) {
        MinButtonViewBtn *btn = [[MinButtonViewBtn alloc]initWithFrame:CGRectMake(550*fw, 15, 100, 20) andType:ButtonImageInRight];
        btn.bottomLabel.text = [PublickFunctionObject getTimeCurrent];
        btn.bottomLabel.font = [UIFont systemFontOfSize:12];
        btn.bottomLabel.textColor = TITLECOLOR;
        btn.topImage.image = [UIImage imageNamed:@"arrow_down"];
        [btn addTarget:self action:@selector(timeClick:) forControlEvents:UIControlEventTouchUpInside];
        [btn.bottomLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(@0);
            make.right.equalTo(@0).offset(-15);
        }];
        _timeButton = btn;
    }
    return _timeButton;
}
- (void)timeClick:(MinButtonViewBtn *)sender{
    [self.mainDelegate leftTestButtonClick];
}
- (MinButtonViewBtn *)nianjiButton{
    if (!_nianjiButton) {
        MinButtonViewBtn *btn = [[MinButtonViewBtn alloc]initWithFrame:CGRectMake(550*fw, 15, 69, 20) andType:ButtonImageInRight];
        btn.bottomLabel.text = @"选择班级";
        btn.bottomLabel.font = [UIFont systemFontOfSize:12];
        btn.bottomLabel.textColor = TITLECOLOR;
        btn.topImage.image = [UIImage imageNamed:@"arrow_down"];
        [btn addTarget:self action:@selector(nianjiButton:) forControlEvents:UIControlEventTouchUpInside];
        [btn.bottomLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(@0);
            make.right.equalTo(@0).offset(-15);
        }];
        _nianjiButton = btn;
    }
    return _nianjiButton;
}
- (void)nianjiButton:(MinButtonViewBtn *)sender{
    [self.mainDelegate rightTestButtonClick];
}
@end
